package com.kandinfo.base.admin.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.kandinfo.base.admin.domain.ScheduleJob;
import com.kandinfo.base.common.repository.BaseRepository;


public interface ScheduleJobJPARepository extends BaseRepository<ScheduleJob, Long>{
    
    @Query(value = "select * from quartz_job qj where  qj.bean_class = ?1 and qj.spring_id = ?2 and qj.method_name = ?3",nativeQuery = true)
    ScheduleJob IsThere(String beanClass,String springId,String methodName);
    
    @Modifying
    @Query(value = "delete from quartz_job where id = ?1 ", nativeQuery = true)
    void deleteOne(Long id);

    @Query(value = "select * from quartz_job qj where qj.job_status = ?1 ", nativeQuery = true)
	List<ScheduleJob> findByStatus(int i);
}
